<template>
  <div class="main">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page.sync="currentPage"
      :page-size="8"
      layout="prev, pager, next, jumper"
      :total="total">
    </el-pagination>

  </div>
</template>

<script>
export default {
  props:['total'],
   methods: {
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        this.$emit('changepage',val)
        console.log(`当前页: ${val}`);
      }
    },
    data() {
      return {
        currentPage: 2,
      };
    }
}
</script>

<style scoped>
.main{
  text-align: center;
}
</style>